2011

您所在的位置:网站首页 tridion schema 2011

2011

2023-08-10 21:04| 来源: 网络整理| 查看: 265

There is no reason in principle not to use one namespace for multiple schemas, as long as those schemas don't attempt to define the same types.

A namespace is a mechanism to enable you to prevent name collisions. If you have some other factor helping to prevent such collisions, there's no reason why namespaces should do all the hard work.

The most important thing is that you have a design and that you follow it. If half your developers expect one namespace per schema, and the rest are also using root element names or whatever, you're in trouble.

A namespace is not supposed to uniquely identify a schema or a document. A "find schemas by namespace" feature might sound clever, but I'd suggest re-reading the recommendations before implementing it. It's certainly not what namespaces were intended for.

I do recommend replacing Tridion's default GUID-based namespace URIs. The main reason for this is that you will usually want to reference them in code, and GUIDs are a right bugger to type accurately and/or verify visually. Ideally, choose a scheme whereby you can reliably predict casing and the like - it just makes life easier. Using a meaningful name is also good. It might help if your component XML gets exported to an external system: people will know where it came from.

Another reason for specifying your own URIs is if you are importing data for a pre-existing schema.

Having said all of that, although I disagree that using the same namespace for more than one schema is a terrible idea, I'm not thoroughly convinced that it's a good idea. Judgement must be applied.



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3